// @flow
import { sample, capitalizeAll } from '../utils';

export const generateRandomName = () =>
  capitalizeAll(`${sample(prefixes)} ${sample(suffixes)}`);

const adjectives = [
  'clean',
  'elegant',
  'magnificent',
  'charming',
  'whimsical',
  'glamorous',
  'stylish',
  'ambitious',
  'brave',
  'wonderful',
  'witty',
  'sassy',
  'thunder',
  'lightning',
  'stormy',
  'sunny',
  'rhythmic',
  'old-fashioned',
  'fresh',
  'vivacious',
  'calming',
  'delightful',
  'nutritious',
  'icy',
  'abundant',
  'incalculable',
  'substantial',
  'jovial',
  'snow',
  'magic',
  'magical',
  'red',
  'blue',
  'green',
  'yellow',
  'powerful',
  'prickly',
  'introspective',
  'backwards',
  'upside-down',
  'rotated',
  'crooked',
];

// These are not-really-adjectives, but they still work in the form of
// "adjective-noun".
const pseudoAdjectives = [
  'mango',
  'ocean',
  'forest',
  'much',
  'summer',
  'spring',
  'winter',
  'autumn',
  'fire',
  'ice',
];

// Exported so we can test the generation of the project name (generateRandomName())
export const prefixes = [...adjectives, ...pseudoAdjectives];

const animalNames = [
  'cat',
  'dog',
  'ocelot',
  'lynx',
  'ferret',
  'capybara',
  'narwhal',
  'fox',
  'raccoon',
  'camel',
  'goat',
  'cheetah',
  'jaguar',
  'tiger',
  'lion',
  'panther',
  'leopard',
  'bobcat',
  'alligator',
  'baboon',
  'bear',
  'bee',
  'butterfly',
  'chimpanzee',
  'coyote',
  'dinosaur',
  'dolphin',
  'fish',
  'elephant',
  'toad',
  'hamster',
  'kangaroo',
  'koala',
  'monkey',
  'panda',
  'porcupine',
  'rabbit',
  'salmon',
  'turtle',
  'wolf',
  'zebra',
  // do not be alarmed, the following are not real animals
  'centaur',
  'fairy',
  'gnome',
  'griffin',
  'hydra',
  'manticore',
  'mermaid',
  'pegasus',
  'phoenix',
  'pixie',
  'satyr',
  'unicorn',
  'valkyrie',
  'vampire',
  'werewolf',
  'zombie',
];

const objects = [
  'toaster',
  'microwave',
  'blender',
  'kettle',
  'fireworks',
  'thing',
  'plane',
  'spork',
  'storybook',
  'planet',
  'bottle',
  'tea',
  'coffee',
  'apple',
  'avocado',
  'cherry',
  'banana',
  'pineapple',
  'kiwi',
  'grapefruit',
  'lemon',
  'lime',
  'kumquat',
  'pomagranate',
  'strawberry',
  'tangerine',
  'watermelon',
  'winter',
];

const miscNouns = [
  'time',
  'people',
  'world',
  'country',
  'story',
  'book',
  'application',
  'force',
  'magic',
  // For some reason, I really like the `thing` suffix.
  // Let's make it more likely...
  'thing',
  'thing',
  'thing',
  'thing',
  'thing',
];

// Exported so we can test the generation of the project name (generateRandomName())
export const suffixes = [...animalNames, ...objects, ...miscNouns];
